package com.zby.controller.user;

import com.zby.common.utils.ResultUtil;
import com.zby.model.pojo.UserInfo;
import com.zby.service.UserInfoService;
import com.zby.vo.UserInfoVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/userInfo")
@Tag(name = "用户详情管理")
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;


//    查询用户详情
//    插入用户详情
    @Operation(summary = "修改用户详情")
    @PostMapping(value = "/updateUserInfo")
    public ResultUtil<UserInfoVo> insertUserInfo(@RequestBody UserInfoVo userInfo){
        userInfoService.updateUserInfo(userInfo);
        return ResultUtil.success();
    }
//    获取用户详情
    @Operation(summary = "获取用户详情")
    @GetMapping(value = "/selectUserInfo")
    public ResultUtil<UserInfoVo> selectUserInfo(){
       UserInfoVo userInfo = userInfoService.selectUserInfo();
        return ResultUtil.success(userInfo);
    }


}
